#include <stdio.h>
#include "http.h"
#include <event.h>
#include <signal.h>

void signal_cb(int fd,short event,void *arg)
{
	struct event *signal=arg;
	printf("%s: got signal %d\n", __func__, EVENT_SIGNAL(signal));
	event_del(signal);
}

int main(int argc,char **argv)
{
	int port=80;
	char *ip="218.30.115.226";
	int fd=client_socket(ip,port);
	event_init();
	struct event s;
	event_set(&s,SIGPIPE,EV_SIGNAL|EV_PERSIST,signal_cb,&s);
	event_add(&s,NULL);
	event_dispatch();
	return 0;
}
